<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

// 用户
Route::post('/api/user/register', 'api/user/register')->middleware('Check');
Route::post('/api/user/login', 'api/user/login')->middleware('User');

// 文章
Route::get('/api/article/list', 'api/article/getList');
Route::post('/api/article/add', 'api/article/addArticle')->middleware('Check');
Route::post('/api/article/delete', 'api/article/deleteArticle')->middleware('Check');
// Route::post('/api/article/update', 'api/article/updateArticle')->middleware('Check');
// app接口
Route::get('/api/article/typelist', 'api/article/getTypeList');


// ip
Route::get('/api/ip/add', 'api/ip/addIp');

// 专题
Route::post('/api/project/add', 'api/project/addProject')->middleware('Check');
Route::post('/api/project/delete', 'api/project/deleteProject')->middleware('Check');
Route::post('/api/project/update', 'api/project/updateProject')->middleware('Check');
Route::get('/api/project/list', 'api/project/getList');

// 标签
Route::post('/api/type/add', 'api/type/addType')->middleware('Check');
Route::post('/api/type/delete', 'api/type/deleteType')->middleware('Check');
Route::get('/api/type/list', 'api/type/getList');

Route::post('/api/test', 'api/test/index');


// 微信小程序接口

/**
 * 期刊接口
 */
// 获取最新期刊
Route::get('/api/classic/get', 'wx/classic/getLatest');
// 编辑期刊
Route::post('/api/classic/add', 'wx/classic/addClassic');
// 获取某一期的期刊
Route::get('/api/classic/getByIndex', 'wx/classic/getClassicByIndex');
// 获取点赞信息
Route::get('/api/classic/getFavor', 'wx/classic/getFavor');
// 获取我喜欢的期刊
Route::get('/api/classic/myFavor', 'wx/classic/getMyFavor');
// 喜欢期刊
Route::post('/api/classic/like', 'wx/favor/addFavor');
// 取消喜欢期刊
Route::post('/api/classic/cancel', 'wx/favor/cancelFavor');
/**
 * 书籍接口
 */
// 获取喜欢书籍的数量
Route::get('/api/favor/getBookFavorNum', 'wx/favor/getBookFavorNum');
// 获取热门书籍
Route::get('/api/book/list', 'wx/book/getBookList');
// 编辑书籍
Route::post('/api/book/add', 'wx/book/addBook');
// 获取书籍详情
Route::get('/api/book/detail', 'wx/book/getDetail');
// 获取书籍短评
Route::get('/api/comment/list', 'wx/book/getComment');
// 获取书籍喜欢
Route::get('/api/book/favor', 'wx/book/getFavor');
/**
 * 短评
 */

Route::post('/api/comment/add', 'wx/comment/addComment');
// 获取热门标签
Route::get('/api/hot/list', 'wx/book/getHot');
// 查找书籍
Route::get('/api/book/search', 'wx/book/searchBook');

return [

];
